package com.example.books.data;

import org.litepal.annotation.Column;
import org.litepal.crud.LitePalSupport;

public class Collection extends LitePalSupport {
    @Column(nullable = false)
    private int userId;
    @Column(nullable = false)
    private Long bookId;
    @Column(unique = true,defaultValue = "")
    private String ids;

    public Collection() {
    }

    public Collection(int userId, Long bookId) {
        this.userId = userId;
        this.bookId = bookId;
        ids=ids+userId+bookId;
    }


    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
        ids=ids+"$"+userId;
    }

    public Long getBookId() {
        return bookId;
    }

    public void setBookId(Long bookId) {
        this.bookId = bookId;
        ids=ids+"#"+bookId;
    }
}
